package StrategyPattern;

public  abstract class Duck {

    FlyInterface flyInterface;
    QuekcInterface quekcInterface;

    public String swim() {
        return "鸭子会游泳";
    }
    public abstract void display();

    public String  performFly() {
        String fly = flyInterface.fly();

        return   fly;
    }

    public String performQuack() {
        String quakc = quekcInterface.quakc();
        return quakc;
    }


    public void setFlyBehavior(FlyInterface fb) {
        flyInterface = fb;
    }
    public void setQuackBehavior(QuekcInterface qb) {
        quekcInterface= qb;
    }


}
